/*
 * $Id: dprint.h,v 1.6 2005-04-24 08:09:46 bacon Exp $
 */

#ifndef _XP_BAS_DPRINT_H_
#define _XP_BAS_DPRINT_H_

#include <xp/bas/stdio.h>

#ifdef NDEBUG
	#define xp_dprint0(x)
	#define xp_dprint1(x,a1)
	#define xp_dprint2(x,a1,a2)
	#define xp_dprint3(x,a1,a2,a3)
	#define xp_dprint4(x,a1,a2,a3,a4)
	#define xp_dprint5(x,a1,a2,a3,a4,a5)
#else
	#define xp_dprint0(x) { \
		xp_fprintf (xp_stderr, XP_TEXT("[%s,%d] "), \
			XP_TEXT(__FILE__), __LINE__); \
		xp_fprintf (xp_stderr, x); \
	}
	#define xp_dprint1(x,a1) { \
		xp_fprintf (xp_stderr, XP_TEXT("[%s,%d] "), \
			XP_TEXT(__FILE__), __LINE__); \
		xp_fprintf (xp_stderr, x, a1); \
	}
	#define xp_dprint2(x,a1,a2) { \
		xp_fprintf (xp_stderr, XP_TEXT("[%s,%d] "), \
			XP_TEXT(__FILE__), __LINE__); \
		xp_fprintf (xp_stderr, x, a1, a2); \
	}
	#define xp_dprint3(x,a1,a2,a3) { \
		xp_fprintf (xp_stderr, XP_TEXT("[%s,%d] "), \
			XP_TEXT(__FILE__), __LINE__); \
		xp_fprintf (xp_stderr, x, a1, a2, a3); \
	}
	#define xp_dprint4(x,a1,a2,a3,a4) { \
		xp_fprintf (xp_stderr, XP_TEXT("[%s,%d] "), \
			XP_TEXT(__FILE__), __LINE__); \
		xp_fprintf (xp_stderr, x, a1, a2, a3, a4); \
	}
	#define xp_dprint5(x,a1,a2,a3,a4,a5) { \
		xp_fprintf (xp_stderr, XP_TEXT("[%s,%d] "), \
			XP_TEXT(__FILE__), __LINE__); \
		xp_fprintf (xp_stderr, x, a1, a2, a3, a4, a5); \
	}

#endif

#endif
